Musical instruments that play different pitches have some way for the musician to specify which pitch to play. Manipulating an instrument in a certain way will produce a particular pitch. For example, pressing A on the piano will produce a pitch at about 440 Hz, pressing the first fret on the E string of a standard guitar will produce a pitch corresponding to F, etc. Other instruments separate what determines the pitch from what plays the pitch. In wind instruments like flutes or horns, the holes are blocked with the fingers or buttons to indicate pitch, but a note is played only when wind is blown into the mouthpiece. With stringed instruments like guitars or violins, a string is pressed at a certain spot on the neck to indicate the pitch, and the pitch is turned into sound by plucking, striking, or scraping the string at a different location. Sometimes, such as with flutes and trumpets, the pitch can also be made to jump an octave, or bend a little, by blowing into the mouthpiece differently.
In Western music, there are traditionally 12 notes in an octave. An octave of any note is double or half its frequency. The twelve notes, in equal temperament tuning, are approximately evenly proportioned jumps in frequency. This is commonly referred to as the chromatic Western scale. For example, a full sized piano has 88 keys and can represent seven octaves and four additional notes.
MIDI (Musical Instrument Digital Interface) is a technical standard that describes a protocol, digital interface and connectors, that allows a wide variety of electronic musical instruments, computers, and other related devices to connect and communicate with one another. MIDI carries event messages that specify notation, pitch and velocity, control signals for parameters such as volume, vibrato, audio panning, cues, and clock signals that set and synchronize tempo between multiple devices. These messages are sent via a MIDI cable to other devices where they control sound generation and other features.
In its simplest form, a MIDI instrument sends NOTE_ON and NOTE_OFF events, including a note number that corresponds to notes in the chromatic Western scale. The receiving device, such as a synthesizer, reads the MIDI events and transforms the notes into actual sounds at particular frequencies. Besides NOTE_ON and NOTE_OFF events, MIDI can also send events that dynamically change the volume, bend the pitch, or control various musical effects.